import type { CategoryDTO, CategoryVO, TagVo } from './data'
import { Http } from '@/network/request'

export const getCategoriesApi = (dto: CategoryDTO.Get) => {
  return Http.post<CategoryDTO.Get, CategoryVO.Get>('/admin/codeDuckQuestionCategory/listQuestionCategory', dto)
}

export const putCategoryApi = (dto: CategoryDTO.Put) => {
  return Http.post<CategoryDTO.Put, true>('/admin/codeDuckQuestionCategory/saveOrUpdateQuestionCategory', dto)
}

export const deleteCategoriesApi = (dto: CategoryDTO.Delete) => {
  return Http.post<CategoryDTO.Delete, true>('/admin/codeDuckQuestionCategory/deleteQuestionCategoryByIds', dto)
}

export const getTagsApi = () => {
  return Http.get<null, TagVo.Get>('/codeDuckTag/listAndQuestionCategory')
}
